
---@class RedDotsUIRankingLikeHandler
RedDotsUIRankingLikeHandler ={}
local this = RedDotsUIRankingLikeHandler

function RedDotsUIRankingLikeHandler.init()
    CloseEvent(Config.EventType.FreshRankingLikeNum, this.update);
    ListenEvent(Config.EventType.FreshRankingLikeNum, this.update); 
    return this
end

--
function RedDotsUIRankingLikeHandler.getFlag(notShow)
    --nil为总红点判断
    if notShow==true then
        return Config.RedDotsFlagState.None
    end
    if logicMgr.FuncOpenManager.isOpen(Config.FuncOpenType.City) then
        local mapId = logicMgr.MapManager.getMapId()
        if mapId >= 203 then
            local day_like_count = G.dataTable["t_global"][tostring(305)].f_int_value or 0
            local have_day_like_count = logicMgr.NoticeManager.dayClick or 0
            if have_day_like_count < day_like_count then
                return Config.RedDotsFlagState.Needful 
            end
        end 
    end
    return Config.RedDotsFlagState.None
end


function RedDotsUIRankingLikeHandler.update()
    RedDotsManager.addBroadcast(Config.RedDotsType.UIRankingLike)
end